package gogoqiu.java.base;

import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.AnsiConsole;
import static org.fusesource.jansi.Ansi.Color.*;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

public class console {
    public enum Level{
        info, warn, error
    }

    private static final Logger logger = LogManager.getLogger("consoleOnly");
    
    public static void outputErr( String s, Object ...params ){
        //System.out.println(Ansi.ansi().fg(GREEN).a(s));
        logger.error( s, params );
    }

    public static void outputWarn( String s, Object ...params ){
        //System.out.println(Ansi.ansi().fg(YELLOW).a(s));
        logger.warn(s, params);
    }

    public static void outputInfo( String s, Object ...params ){
        //System.out.println(Ansi.ansi().fg(RED).a(s));
        logger.info(s, params);
    }

    public static void outputSeq( Level level ){        
        if( level==Level.error ){
            outputErr("-----------------------------------------------");
        }else if( level==Level.warn ){
            outputWarn("-----------------------------------------------");
        }else if( level==Level.info ){
            outputInfo("-----------------------------------------------");
        }    
    }
}
